// DSTapeMountView.h : interface of the CDSTapeMountView class
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INCLUDES()
#include "Util/msflexgrid.h"
//}}AFX_INCLUDES

#if !defined(AFX_DSTapeMountVIEW_H__77651E88_693E_4EF0_A538_9BB3073ADB58__INCLUDED_)
#define AFX_DSTapeMountVIEW_H__77651E88_693E_4EF0_A538_9BB3073ADB58__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include ".\Util\MinButton.h"
#include ".\Util\MinLabel.h"
#include ".\Util\MinDigital.h"
#include ".\Util\SxGroupBox.h"


// Hardware Layer
class IIO;
class IOnLine;
class IAXIS1;
// Process Layer
class IAutoManager;
class ITrsRobotBuffer;
class ITrsLoaderPort;
class ITrsRingHandler;
class ITrsWaferTapeMount;
class ITrsUnloaderLifter;


class IRobotBuffer;
class ILoaderPort;
class IRingHandler;
class IWaferTapeMount;

// Common Layer
class CSystemData;
class CErrorCodeData;
class CDSTapeMountDoc;
class CModelData;
class CMappingData;
class COnLine;
class CRingHandlerPosData;

class CDSTapeMountView : public CFormView
{
private:
	IIO* m_lnkIO;
	BOOL m_bErrorDisplay;
	

protected: // create from serialization only
	CDSTapeMountView();
	DECLARE_DYNCREATE(CDSTapeMountView)

public:
	//{{AFX_DATA(CDSTapeMountView)
	enum { IDD = IDD_DSTAPEMOUNT_FORM };
	CMinButton	m_bRinInput;
	CMinButton	m_bQuit;
	CMinButton	m_bTableChange;
	CMinButton	m_bErrorList;
	CMinButton	m_bTapeChange;
	CMinButton	m_bCutterChange;
	CMinButton	m_bSettingMode;
	CMinButton	m_bRunMode;
	CMinButton	m_bOrigin;
	CMinButton	m_bModelChange;
	CMinButton	m_bManualMode;
	CMinButton	m_bMainMode;
	CMinButton	m_bDataMode;
	CMinButton	m_bCycleStop;
	CMinButton	m_bAutoStop;
	CMinButton	m_bAutoStart;
	CMinButton	m_bAutoInit;
	CMSFlexGrid	m_gridModelInfo;
	CMSFlexGrid	m_gridSystemInfo;
	CMSFlexGrid	m_gridProcductInfo;
	//}}AFX_DATA

// Attributes
public:
	CDSTapeMountDoc* GetDocument();
	void Draw1();
	void Draw2();
	void Draw3();
	void Draw4();
	void Draw5();
	void Draw6();
	void Draw7();
	void Draw8();
	void ErrorDisplay(int nErrorCode);

	void PeekAndPump();
	void DisplayMachineTact(CString strTact);
	CMinLabel	m_sHiCheck[25];
	BOOL m_flgMappingData[25];
	int iWorkPosData[25];

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDSTapeMountView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CDSTapeMountView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
	
protected:
	void MoveWafer();
	void LabelInitial();
	void ButtonInitial();
	void DisplayOpMode();
	void GridInitial();
	
	IAutoManager* m_lnkAutoManager;
	ITrsRobotBuffer* m_lnkTrsRobotBuffer;
	ITrsLoaderPort* m_lnkTrsLoaderPort;

	ITrsRingHandler* m_lnkTrsRingHandler;
	ITrsWaferTapeMount* m_lnkTrsWaferTapeMount;
	ITrsUnloaderLifter* m_lnkTrsUnloaderLifter;

	IRingHandler* m_lnkRingHandler;
	IWaferTapeMount* m_lnkWaferTapeMount;

	IRobotBuffer* m_lnkRobotBuffer;
	ILoaderPort* m_lnkLoaderPort;

	CErrorCodeData* m_lnkErrorCodeData;
	CDSTapeMountDoc* m_pDoc;
	CSystemData* m_lnkSystemData;
	CModelData* m_lnkModelData;

	CMappingData* m_lnkMappingData;
	CRingHandlerPosData* m_lnkRingHandlerPosData;
	IOnLine* m_lnkOnLine;

	UINT m_nTimerID;
	BOOL m_TimerInitFlag;
	BOOL m_fDoor1;
	BOOL m_fDoor2;
	BOOL m_fDoor3;
	BOOL m_fDoor4;
	BOOL m_fDoor5;
	BOOL m_fDoor6;
	BOOL m_fDoor7;
	BOOL m_fDoor8;
	int m_fMovewafer;
// Generated message map functions
protected:
	//{{AFX_MSG(CDSTapeMountView)
	afx_msg void OnQuitBtn();
	afx_msg void OnMainmode();
	afx_msg void OnDatamode();
	afx_msg void OnManualmode();
	afx_msg void OnSettingmode();
	afx_msg void OnPaint();
	afx_msg void OnModelChange();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnDestroy();
	afx_msg void OnAutoInit();
	afx_msg void OnOrigen();
	afx_msg void OnRunMode();
	afx_msg void OnAutoStart();
	afx_msg void OnAutoStop();
	afx_msg void OnCycleStop();
	afx_msg void OnStepStop();
	afx_msg void OnCutterChange();
	afx_msg void OnTapeChange();
	afx_msg void OnClickGridSystemInfo();
	afx_msg void OnErrorList();
	afx_msg void OnClickGridProductionInfo();
	afx_msg void OnTableChange();
	afx_msg void OnRingInput();
	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in DSTapeMountView.cpp
inline CDSTapeMountDoc* CDSTapeMountView::GetDocument()
   { return (CDSTapeMountDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DSTapeMountVIEW_H__77651E88_693E_4EF0_A538_9BB3073ADB58__INCLUDED_)
